package com.dlc.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dlc.shop.bean.dto.WarehouseAreaDTO;
import com.dlc.shop.bean.model.WarehouseArea;
import com.dlc.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 仓库项和供货城市关联信息
 *
 * @author FrozenWatermelon
 * @date 2023-11-08 11:11:44
 */
public interface WarehouseAreaMapper extends BaseMapper<WarehouseArea> {

    /**
     * 获取仓库项和供货城市关联信息列表
     * @param pageDTO
     * @return 仓库项和供货城市关联信息列表
     */
    IPage<WarehouseArea> list(PageParam pageDTO);

    /**
     * 根据仓库项和供货城市关联信息id获取仓库项和供货城市关联信息
     *
     * @param warehouseAreaId 仓库项和供货城市关联信息id
     * @return 仓库项和供货城市关联信息
     */
    WarehouseArea getByWarehouseAreaId(@Param("warehouseAreaId") Long warehouseAreaId);

    /**
     * 保存仓库项和供货城市关联信息
     * @param warehouseArea 仓库项和供货城市关联信息
     */
    void save(@Param("warehouseArea") WarehouseArea warehouseArea);

    /**
     * 更新仓库项和供货城市关联信息
     * @param warehouseArea 仓库项和供货城市关联信息
     */
    void update(@Param("warehouseArea") WarehouseArea warehouseArea);

    /**
     * 根据仓库项和供货城市关联信息id删除仓库项和供货城市关联信息
     * @param warehouseAreaId
     */
    void deleteById(@Param("warehouseAreaId") Long warehouseAreaId);

    /***
     * 批量插入关联信息
     * @param warehouseAreaList
     */
    void batchSave(@Param("warehouseAreaList")List<WarehouseAreaDTO> warehouseAreaList);

    /**
     * 批量删除关联信息
     * @param warehouseId
     */
    void deleteByWarehouseId(@Param("warehouseId") Long warehouseId);
}
